Stepper motors give you a very precise movement of a number of steps. They are used in things like 3D printers, CNC machines, etc.
Connect the 4 wires from the stepper to MOTOR1 and MOTOR2 in pairs. One pair goes to MOTOR1 and the other pair goes to MOTOR2.
Connect a battery to the + and - connectors (+ to red) on the Kitronik board.
You need to add the Kitronik extension. Copy the PicoRobotics.py file from the lib directory on github to the lib directory on the pico:
Ensure you have the Kitronik Robotics Board library added and then enter the following code:
See code on github# Test stepper with kitronik robotics board
import PicoRobotics
import time
# Create robotics object
robot = PicoRobotics.KitronikPicoRobotics()
# Turn stepper 1 forward then backward
robot.step(1, "f", 50)
robot.step(1, "r", 50)